//路由配置
import Layout from "@/pages/Layout";
import Login from "@/pages/Login";

//二级页面
import Home from "@/pages/Home";
import Article from "@/pages/Article";
import Publish from "@/pages/Publish";

import {createBrowserRouter} from 'react-router-dom'
import { AuthRoute } from "@/components/AuthRoute";

const router = createBrowserRouter([
    {
        path:'/',
        element:<AuthRoute><Layout/></AuthRoute>,
        children:[
            
            {
                path:'article',
                element:<Article/>
            },
            {
                path:'publish',
                element:<Publish/>
            },
            {
                index:true,
                element:<Home/>
            }
        ]
    },
    {
        path:'/login',
        element:<Login/>
    }
])
export default router